﻿<?
	include "config.php";
	include("seguranca.php"); // Inclui o arquivo com o sistema de segurança
    protegePagina(); // Chama a função que protege a página
	if($_SESSION['nivel'] != 'administrador'){ //Se não for ADM desloga o usuário e expulsa da página
		expulsaVisitante();
	}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   	<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
	<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="css/bootstrap.css" />
    <title>Atualizar Tema</title>
</head>

<body>
<?
	if(isset($_GET['action']) && $_GET['action'] == 'atualizar'){
		$id = $_GET['id'];
		$_SESSION['edita'] = $id;
		$consulta = $db->query ("SELECT * FROM areas WHERE id = '$id'");
		$linha = $consulta->fetch(PDO::FETCH_ASSOC);
?>
    <div class="container">
    
    <header class="masthead">
	<h1 class="muted" align="center">Atualizar Temas de perguntas</h1>
                
    <form id="form1" name="form1" method="post" action="atualizaTema.php" autocomplete="on">
    
          	<p><span id="sprytextfield1">
            <label for="area">Área:</label>
            <input type="text" name="area" id="area" value="<? echo "{$linha['area']}" ?>"/>
            <span class="textfieldRequiredMsg">Informe o nome da Área.</span></span></p>
            <p>
    
    	<input type="submit" name="atualizar" class="btn btn-primary" value="Atualizar"></p>
    
    </form>
	<? } ?>
</body>
<script type="text/javascript">
	var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");

</script>
</html>